<style lang="less" scoped>
@import url('./style.less');

.panel {
  &-title {
    &__label {
      color: #3399fe;
    }
    &__right {
      display: flex;
      font-size: 14px;
    }
  }
}
</style>
<template>
  <div class="panel">
    <div class="panel-title" @click="farenClick">
      <div class="panel-title__label">{{item.Name||'-'}}</div>
      <div class="panel-title__right" v-if="isFaren">对外投资与任职
        <i class="iconfont icon-more"></i>
      </div>
    </div>
    <div class="panel-content">
      <div class="panel-content__item">
        <div class="panel-content__item-label">认缴出资时间</div>
        <div class="panel-content__item-value">{{item.ShouldDate||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">实缴出资时间</div>
        <div class="panel-content__item-value">{{item.RealDate||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">认缴出资额</div>
        <div class="panel-content__item-value">{{item.ShouldCapi||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">实缴出资额</div>
        <div class="panel-content__item-value">{{item.RealCapi||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">认缴出资方式</div>
        <div class="panel-content__item-value">{{item.ShouldType||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">实缴出资方式</div>
        <div class="panel-content__item-value">{{item.RealType||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: ['item'],
  computed: {
    isFaren() {
      if (!this.item.KeyNo) {
        return false;
      }
      return this.item.KeyNo.indexOf('p') === 0;
    }
  },
  methods: {
    farenClick() {
      if (this.isFaren) {
        // 法人
        const Oper = {
          Name: this.item.Name,
          KeyNo: this.item.KeyNo
        };
        this.$router.push({
          path: '/pages/base/faren/main',
          query: {
            Oper: JSON.stringify(Oper)
          }
        });
        return;
      }
      // 企业
      this.$router.push({
        path: '/pages/company/main',
        query: {
          unique: this.item.CompanyId
        }
      });
    }
  }
};
</script>
